package ArithmeticObjects;

import ArithUtils.BigNumber;
import MathObjects.Field;
import MathObjects.Ring;

/**
 * @author Shir Peleg
 * In this class we have static functions, that creates spatial instances of general Objects
 * we have implemented.
 */

public class staticTypes {
	/**
	 * @param p
	 * @return Fp the general field with p elements
	 */

	public static BTField<BigNumber> getNumberField(final BigNumber p)
	{
		
		return new BTField<BigNumber>(
				new Field<BigNumber>(UsfulOppStructs.getAddOp(p),
						UsfulOppStructs.getMultOp(p, p.substract(BigNumber.ONE)), p), UsfulOppStructs.getMGtoBT(), UsfulOppStructs.getMGfromBT());
	}
	/**
	 * @param p
	 * @return Zp the general field with p elements
	 */
	public static BTRing<BigNumber> getNumberRing(final BigNumber p)
	{
		return new BTRing<BigNumber>(
				new Ring<BigNumber>(UsfulOppStructs.getAddOp(p),
						UsfulOppStructs.getMultOp(p), p), UsfulOppStructs.getMGtoBT(), UsfulOppStructs.getMGfromBT());
	}
}
